﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class CustomerLogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }



    [System.Web.Services.WebMethod]

    public static string CheckUserName(string userName)
    {       

        string returnValue = string.Empty;

        try
        {         

            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["conString"].ConnectionString);

            SqlCommand cmd = new SqlCommand("MAS_pCheckUserAvailability", con);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@UserName", userName.Trim());

            con.Open();

            returnValue = cmd.ExecuteScalar().ToString();

            con.Close();
        }

        catch
        {
            returnValue = "error";
        }

        return returnValue;
    }

}